/**
 * The proxy for function cometExecIE.
 *
 * @name: cometProxyIE
 * @author: luoluo
 * @date: 2009-03-18
 * @version: 1.0
 *
 * @param{scriptURL}: The url for request for updated scripts, it should be host on the same domain.
 * @param{delay}: Delay time.
 * @param{nocache}: Wheather append random string with the URL to prevent cache.
 *
 * @sample:
 *
 * cometProxyIE("script.js", 5000, true);
 *
 */
function cometProxyIE(scriptURL, delay, nocache) {
	setInterval(function() {
		if (nocache == true) {
			if (scriptURL.indexOf("?") > 0) {
				var url = scriptURL + "&" + Math.random();
			} else {
				var url = scriptURL + "?" + Math.random();
			}
		}

		var xmlhttp = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
		xmlhttp.open("get", url, true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				if (xmlhttp.status == 200) {
					try {
						window.parent.name = xmlhttp.responseText;
					} catch (e) {
					
					}
				}
			}
		}
		xmlhttp.send(null);
	}, delay);
}